home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tex / macros / contrib / version.sty < prev    next >
Encoding:
Text File  |  1995-03-15  |  2.7 KB  |  91 lines

  1. %% 
  2. %% This is file `version.sty', generated 
  3. %% on <1995/3/5> with the docstrip utility (2.2i).
  4. %% 
  5. %% The original source files were:
  6. %% 
  7. %% version.dtx  (with options: `paketkod')
  8. %% 
  9. %% Copyright (c) 1994 by Mats Dahlgren <matsd@physchem.kth.se>. 
  10. %% All rights reserved. See the file `version.ins' for information 
  11. %% on how you may (re-)distribute the `version' package files. 
  12. %% 
  13. \NeedsTeXFormat{LaTeX2e}[1994/06/01]
  14. \ProvidesPackage{version}%
  15.   [1994/12/28 Version numbering of LaTeX files (v. 1.0).]
  16. \typeout{The `version' package included.  (c) 1994 by Mats Dahlgren.}
  17. \DeclareOption{one}{%
  18.   \typeout{Option `one' is default for `version'.}
  19. }
  20. \DeclareOption{ten}{%
  21.   \renewcommand{\version}{%
  22.     \ifKeepVersion \else
  23.       \stepcounter{versionnrten}
  24.       \ifnum\theversionnrten=10\stepcounter{versionnr} \fi
  25.       \@skrivner
  26.     \fi
  27.     \theversionnr .\theversionnrten
  28.   }
  29. }
  30. \DeclareOption{hundred}{%
  31.   \renewcommand{\version}{%
  32.     \ifKeepVersion \else
  33.       \stepcounter{versionnrhundred}
  34.       \ifnum\theversionnrhundred=10\stepcounter{versionnrten} \fi
  35.       \ifnum\theversionnrten=10\stepcounter{versionnr} \fi
  36.       \@skrivner
  37.     \fi
  38.     \theversionnr .\theversionnrten\theversionnrhundred
  39.   }
  40. }
  41. \DeclareOption*{\typeout{The option `\CurrentOption '\space
  42.   is not used by `version'.}}
  43. \newcounter{versionnr}
  44. \newcounter{versionnrten}[versionnr]
  45. \newcounter{versionnrhundred}[versionnrten]
  46. \@addtoreset{versionnrhundred}{versionnr}
  47. \newif\ifKeepVersion \KeepVersionfalse
  48. \newcommand{\keepversion}{\global\KeepVersiontrue}
  49. \newcommand{\stepversion}{\global\KeepVersionfalse}
  50. \def\vrsFile{\jobname.vrs}
  51. \newwrite\@vrs
  52. \newcounter{VrsNr}
  53. \def\@skrivner{%
  54.   \setcounter{VrsNr}{\@partaux}  \addtocounter{VrsNr}{1}
  55.   \let\@vrs=\theVrsNr
  56.   \immediate\openout\@vrs\vrsFile
  57.   \immediate\write\@vrs{\relax}
  58.   \immediate\write\@vrs{%
  59.     \string\newlabel{versionsnummer}{{\theversionnr}{\thepage}}}
  60.   \immediate\write\@vrs{%
  61.     \string\newlabel{versionsnummertio}{{\theversionnrten}{\thepage}}}
  62.   \immediate\write\@vrs{%
  63.     \string\newlabel{versionsnummerhundra}{{\theversionnrhundred}{\thepage}}}
  64.   \immediate\closeout\@vrs{}
  65. }
  66. \newcommand{\version}{%
  67.   \ifKeepVersion \else
  68.     \stepcounter{versionnr}
  69.     \@skrivner
  70.   \fi
  71.   \theversionnr
  72. }
  73. \def\@inp@t#1{\openin1 #1 \ifeof1
  74.     \typeout  {No file #1.}
  75.     \setcounter{versionnr}{\z@}
  76.     \setcounter{versionnrten}{\z@}
  77.     \setcounter{versionnrhundred}{\z@}
  78.   \else\closein1 \relax\@@input #1
  79.     \setcounter{versionnr}{\ref{versionsnummer}}
  80.     \setcounter{versionnrten}{\ref{versionsnummertio}}
  81.     \setcounter{versionnrhundred}{\ref{versionsnummerhundra}}
  82.   \fi
  83. }
  84. \AtBeginDocument{%
  85.   \@inp@t{\vrsFile}
  86. }
  87. \ProcessOptions
  88. \endinput
  89. %% 
  90. %% End of file `version.sty'.
  91.